package vy.org.app.common;

public class Logger {

	public static enum LogLevel {DEBUG, INFO, ERROR} ;
	
	public static void log(LogLevel level, String message) {
		if(level.equals(LogLevel.ERROR)){
			System.out.println("ERROR :: " + message);
		}else{
			System.out.println("INFO :: " + message);
		}
	}
	
	public static void log(LogLevel level, Exception e) {
		if(level.equals(LogLevel.DEBUG)){
			if(e != null){
				if(level.equals(LogLevel.ERROR)){
					System.out.println("ERROR :: " + e.getMessage());
				}else{
					System.out.println("INFO :: " + e.getMessage());
				}
				System.out.println(e);
			}
		}
	}
}
